<script setup lang="ts">
import {ref} from 'vue'
import {onLoad} from "@dcloudio/uni-app";
import {getCover, getSetting} from "@/service/api";
import {useSettingStore} from "@/store";

const settingStore = useSettingStore()
let cover = ref()
onLoad(() => {
  // getCover().then(res => {
  //   console.log(res.data)
  //   cover.value = res.data
  // })
  getSetting().then(res => {
    cover.value = res.data.cover
    settingStore.setSetting(res.data)
    document.title = res.data.site_title
  })
})

const goList = () => {
  uni.navigateTo({
    url: '/pages/index/list'
  })
}
</script>

<template>
  <image :src="cover" mode="scaleToFill" class="w-100% h-100vh" @click="goList"/>
</template>

<style lang="scss" scoped>
</style>

